package com.zhanghw.shop.data.dao;

import com.zhanghw.shop.data.dto.SearchAreaDto;
import com.zhanghw.shop.data.entity.Area;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 地区 Mapper
 *
 * @author 张浩伟
 * @date 2018/11/23
 */
@Mapper
public interface AreaMapper extends BaseMapper<Area> {

    int deleteByPrimaryKey(Long id);

    IPage<Area> findAll(Page page, @Param("condition") SearchAreaDto condition);

    int count(@Param("condition") SearchAreaDto condition);

    List<Area> findByPid(Long pid);

    List<Area> findByLftAndRgt(@Param("lft") Integer lft, @Param("rgt") Integer rgt);

    int batchInsert(List<Area> list);

    List<Area> batchQueryByIds(List<Long> ids);

    List<Area> batchQueryByUuids(List<String> uuids);

    Area findByUuid(String uuid);

    int batchDeleteById(List<Long> ids);

    int batchDeleteByUuid(List<String> uuids);

    int deleteByUuid(String uuid);

}